feat: flags to log stats#766
Open
oortlieb wants to merge 4 commits into
Open
Conversation
|
Sandeep Jain seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
…stats pc.GetStats() on a publisher PeerConnection only returns ICE/transport stats because pion's rtpsender has no collectStats implementation. The per-track RTCP Receiver Report data (packetsLost, jitter, RTT, fractionLost) exists in the pion interceptor stats recorder but is never surfaced. Register a stats.InterceptorFactory via WithInterceptors and capture the Getter in OnNewPeerConnection. In the stats ticker, enumerate senders via pc.GetSenders(), look up each SSRC in the Getter, and append remote-inbound-rtp entries to the combined stats map alongside the existing ICE/transport stats. The JSON output now includes entries with type "remote-inbound-rtp" containing packetsLost, jitter, roundTripTime, and fractionLost for each published track's SSRC.
OnNewPeerConnection fires for both publisher and subscriber PCs since WithInterceptors applies to both. Previously we overwrote statsGetter with the last (subscriber) getter, so g.Get(ssrc) always returned nil for sender SSRCs. Now we collect all getters and try each one per SSRC, breaking on the first hit (the publisher getter). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
stats: populate remote-inbound-rtp per-track packet loss via pion interceptor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We're using the client to publish videos to a room, and want to be able to get stats about the connection. This PR adds two flags to room join (
--statsand --stats`).It's helpful for our use case so wanted to offer it back to the project!